<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@taglib prefix="s" uri="http://www.springframework.org/tags" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>装箱单</title>
    <c:if test="${param.v=='3.0'}">
        <jsp:include page="../../head.jsp"/>
    </c:if>
    <style type="text/css">
        table tr {
            text-align: left;
            font-size: 13px;
            padding: 3px 0px;
        }

        .table_list_name {
            text-align: right
        }

        .packinglist {
            font-size: 18px;
            font-weight: bold;
            padding: 5px 0px;
        }

        .table-border tr td, .table-border tr th {
            border: 1px solid #000;
        }

        .table-border tr th {
            text-align: center;
        }

        .table-margin {
            margin-top: 10px
        }

        .tr_line {
            line-height: 25px;
        }

        .table_txt tr td {
            width: 10%
        }
    </style>
    <script type="text/javascript" src="<s:url value="/js/business/declaration.js"/>"></script>
    <script type="text/javascript" src="<s:url value="/js/business/business.js"/>"></script>
    <script type="text/javascript">

        $(function () {
            var objArray = $("#packingList input[id][type!=hidden][disabled!=disabled]");
            objArray.bind('keypress', function (event) {
                if (event.keyCode == 13) {
                    var inputIndex = getIndex(objArray);
                    var nextInput = objArray.eq(++inputIndex);
                    nextInput.select();
                }
            });
        });
    </script>

</head>
<body>
<div id="packingList" align="center" style="margin: 10px">
    <table id="packingListInfo" style="width: 100%" class="table-input tr_line table_txt">
        <tr>
            <td colspan="6" align="center" class="packinglist">${declare.seller}</td>
        </tr>
        <tr>
            <td colspan="6" align="center" class="packinglist"
                style="border-top:1px solid #DADADA ">装箱单
            </td>
        </tr>
        <tr>
            <td colspan="6" align="center">PACKING LIST</td>
        </tr>
        <tr>
            <td>&nbsp</td>
            <td class="table_list_name">客户名称：</td>
            <td>${declare.buyer}</td>
            <td class="table_list_name">日期：</td>
            <td><fmt:formatDate value="${declare.contract_date}" pattern="yyyy-MM-dd"/></td>
            <td>&nbsp</td>
        </tr>
        <tr>
            <td>&nbsp</td>
            <td class="table_list_name">唛头：</td>
            <td>${declare.carton}</td>
            <td class="table_list_name">运抵国：</td>
            <td>${declare.arrived_country}</td>
            <!-- 			<td class="table_list_name">结汇方式：</td> -->
            <td>&nbsp</td>
        </tr>
    </table>
    <table id="goodsPackingList" style="width: 100%"
           class="ui-jqgrid ui-widget ui-widget-content ui-corner-all tr_line table-margin">
        <tr class="ui-jqgrid-labels">
            <th class="ui-state-default ui-th-column ui-th-ltr">商品名称</th>
            <th class="ui-state-default ui-th-column ui-th-ltr">规格型号</th>
            <th class="ui-state-default ui-th-column ui-th-ltr">件数</th>
            <th class="ui-state-default ui-th-column ui-th-ltr">包装</th>
            <th class="ui-state-default ui-th-column ui-th-ltr">数量</th>
            <th class="ui-state-default ui-th-column ui-th-ltr">毛重G.W.</th>
            <th class="ui-state-default ui-th-column ui-th-ltr">净重N.W.</th>
            <th class="ui-state-default ui-th-column ui-th-ltr">备注</th>
            <th class="ui-state-default ui-th-column ui-th-ltr">操作</th>
        </tr>
        <c:forEach var="cm" items="${declare.commodities}" varStatus="st">
            <tr class="ui-widget-content jqgrow ui-row-ltr">
                <td>${cm.name}</td>
                <td>${cm.key_elements}</td>
                <td>${cm.goods_number}</td>
                <td>${cm.package_type}</td>
                <td>${cm.count}${cm.unit}</td>
                <td>${cm.goods_gross_weight}KG</td>
                <td>${cm.goods_net_weight}KG</td>
                <td>${cm.packinglist_remark}</td>
                <td><a class="ui-button ui-widget ui-state-default ui-corner-all"
                       href="javascript:;"
                       onclick="javascript:window.open('business-declarationPackingDetailed?commodity_id=${cm.id}&goods_number=${cm.goods_number}','装箱单明细','height=600,width=800') ;">查看明细</a>
                </td>
            </tr>
        </c:forEach>
        <tr class="ui-widget-content jqgrow ui-row-ltr">
            <td colspan="2" align="right" style="text-align: right;">合计:</td>
            <td>${declare.goods_count}</td>
            <td>${declare.goods_package}</td>
            <!--<td>${declare.sum_count} ${declare.commodities[0].unit}</td>-->
            <td></td>
            <td>${declare.gross_weight}KG</td>
            <td>${declare.net_weight}KG</td>
            <td></td>
            <td></td>
        </tr>
    </table>
</div>
</body>
</html>
